package kotan.model;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author shuji.w6e
 * @since 1.0
 */
public class ModelListenerHelper {

    List<ModelListener> listeners = new ArrayList<ModelListener>();

    public void add(ModelListener l) {
        listeners.add(l);
    }

    public void remove(ModelListener l) {
        listeners.remove(l);
    }

    protected void notifyListeners() {
        for (ModelListener l : this.listeners) {
            l.onChanged();
        }
    }
}
